﻿using BusinessBingo.Installer;
using Castle.Core;
using Castle.Windsor;

namespace BusinessBingo.Web.Infrastructure
{
    /// <summary>
    /// Bootstrapper for the webapplication
    /// </summary>
    public static class Bootstrapper
    {
        /// <summary>
        /// Static WindsorCastle IoC Container
        /// </summary>
        public static IWindsorContainer Container;

        /// <summary>
        /// Install all dependencies in the container
        /// </summary>
        public static void InstallDependencies(LifestyleType lifestyleType)
        {
            Container = new WindsorContainer();
            Container.Install(
                new WebInstaller(lifestyleType),
                new CommandHandlerInstaller(lifestyleType),
                new QueryHandlerInstaller(lifestyleType),
                new DataInstaller(lifestyleType),
                new ModelInstaller(lifestyleType),
                new CommonInstaller(lifestyleType));
        }
    }
}